﻿<Window x:Class="WpfApplication1.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="400" Width="800">
    <Window.Resources>
        <ScrollViewer x:Key="Qwe1" Name="PART_ContentHost" />
        <Style x:Key="MyStyle1">
            <Setter Property="Border.BorderThickness" Value="10" />
        </Style>
        <ControlTemplate x:Key="MyTexBoxTemplate">
            <Border Initialized="Border_Initialized" Style="{StaticResource MyStyle1}">
                <ScrollViewer Name="PART_ContentHost" />                
            </Border>
        </ControlTemplate>
    </Window.Resources>
    <Border Padding="5" x:Name="Test1" SnapsToDevicePixels="True">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="18"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Border Grid.Row="0" Grid.Column="0" BorderThickness="1" Padding="10,5,10,4">
                    <Border.BorderBrush>
                        <SolidColorBrush>
                            <SolidColorBrush.Color>
                                <Color A="255" R="204" G="204" B="204" />
                            </SolidColorBrush.Color>
                        </SolidColorBrush>
                    </Border.BorderBrush>
                    <Border.Background>                        
                        <SolidColorBrush>
                            <SolidColorBrush.Color>
                                <Color A="255" R="128" G="128" B="128" />
                            </SolidColorBrush.Color>
                        </SolidColorBrush>
                    </Border.Background>
                    <Grid>
                        <TextBlock Text="Customer" FontFamily="Tahoma"
                                   FontWeight="Bold" Foreground="White">
                            <TextBlock.Style>
                                <Style>
                                    <Setter Property="Control.FontSize" Value="25" />
                                </Style>
                            </TextBlock.Style>                            
                        </TextBlock>
                    </Grid>
                </Border>
                <Border Grid.Row="1" Grid.Column="0" BorderThickness="1,0,1,1">
                    <Border.BorderBrush>
                        <SolidColorBrush>
                            <SolidColorBrush.Color>
                                <Color A="255" R="204" G="204" B="204" />
                            </SolidColorBrush.Color>
                        </SolidColorBrush>
                    </Border.BorderBrush>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Row="0" Grid.Column="0" Text="Name:" />
                        <TextBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3" />
                        <TextBlock Grid.Row="1" Grid.Column="0" Text="Contact Name:" />
                        <TextBox Initialized="TextBox_Initialized" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" />
                        <TextBlock Grid.Row="2" Grid.Column="0" Text="Phone:" />
                        <TextBox Grid.Row="2" Grid.Column="1" />
                        <TextBlock Grid.Row="2" Grid.Column="2" Text="Fax:" HorizontalAlignment="Right" />
                        <TextBox Grid.Row="2" Grid.Column="3" />
                        <TextBlock Grid.Row="3" Grid.Column="0" Text="Address:" />
                        <TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" />
                        <TextBlock Grid.Row="4" Grid.Column="0" Text="City:" />
                        <TextBox Grid.Row="4" Grid.Column="1" />
                        <Grid Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2">
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Row="0" Grid.Column="0" Text="State/Province:" />
                            <TextBox Grid.Row="0" Grid.Column="1" />
                        </Grid>
                        <TextBlock Grid.Row="5" Grid.Column="0" Text="ZIP/Postal code:" />
                        <TextBox Grid.Row="5" Grid.Column="1" />
                        <TextBlock Grid.Row="5" Grid.Column="2" Text="Country:" />
                        <TextBox Grid.Row="5" Grid.Column="3" />
                    </Grid>
                </Border>
            </Grid>
            <Button Grid.Row="0" Grid.Column="2" Click="Button_Click">Test1</Button>
        </Grid>
    </Border>
</Window>
